home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / starfire.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  10KB  |  323 lines

  1. /***************************************************************************
  2.   Star Fire
  3.  
  4. driver by Daniel Boris, Olivier Galibert
  5.  
  6. Memory Map:
  7.  
  8. Read:
  9. 0000 - 5FFF: ROM
  10. 8000 - 9FFF: Working RAM
  11. A000 - BFFF: Pallette RAM (best I can figure)
  12. C000 - DFFF: Video RAM
  13. E000 - FFFF: Video RAM
  14.  
  15. 9400,9800  Dip switch
  16.  
  17. 9401:   Bit 0: Coin
  18.         Bit 1: Start
  19.         Bit 2: Fire
  20.         Bit 3: Tie sound on
  21.         Bit 4: Laser sound on
  22.         Bit 5: Slam/Static
  23.         Bit 6,7: high
  24.  
  25. 9805:   Velocity ADC
  26. 9806:   Horizontal motion ADC
  27. 9807:   Vertical motion ADC
  28.  
  29. Write:
  30. 8000 - 9FFF: Working RAM
  31. A000 - BFFF: Pallette RAM (best I can figure)
  32. C000 - DFFF: Video RAM
  33.  
  34. 9402:   Bit 0: Size (something to do with laser sound)
  35.         Bit 1: Explosion sound
  36.         Bit 2: Tie Weapon sound
  37.         Bit 3: Laser sound
  38.         Bit 4: Tacking Computer sound
  39.         Bit 5: Lock sound
  40.         Bit 6: Scanner sound
  41.         Bit 7: Overheat sound
  42.  
  43. 9400:   Video shift control
  44.         Right half of screen:
  45.         Bit 0: Mirror bits
  46.         Bit 1..3: Roll right x bits
  47.         Left half of screen:
  48.         Bit 4: Mirror bits
  49.         Bit 5..7: Roll right x bits
  50.  
  51. 9401:   Bit 0..3: Video write logic function (A = Data written, B = Data in mem)
  52.             0:   A
  53.             1:   A or B
  54.             7:   !A or B
  55.             C:   0
  56.             D:   !A and B
  57.         Bit 4: Roll (something to do with video)
  58.         Bit 5: PROT  (something to do with video)
  59.         Bit 6: TRANS (something to do with pallette RAM)
  60.         Bit 7: CDRM (something to do with pallette RAM)
  61.  
  62. ***************************************************************************/
  63.  
  64. #include "driver.h"
  65. #include "vidhrdw/generic.h"
  66.  
  67. /* In vidhrdw/starfire.c */
  68. void starfire_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  69. extern int starfire_vh_start(void);
  70. extern void starfire_vh_stop(void);
  71. WRITE_HANDLER( starfire_videoram_w );
  72. READ_HANDLER( starfire_videoram_r );
  73. WRITE_HANDLER( starfire_colorram_w );
  74. READ_HANDLER( starfire_colorram_r );
  75.  
  76. /* In machine/starfire.c */
  77. extern int starfire_interrupt (void);
  78. WRITE_HANDLER( starfire_shadow_w );
  79. WRITE_HANDLER( starfire_output_w );
  80. WRITE_HANDLER( fireone_output_w );
  81. READ_HANDLER( starfire_shadow_r );
  82. READ_HANDLER( starfire_input_r );
  83. READ_HANDLER( fireone_input_r );
  84. WRITE_HANDLER( starfire_soundctrl_w );
  85.  
  86.  
  87. unsigned char *starfire_ram;
  88.  
  89. static struct MemoryReadAddress starfire_readmem[] =
  90. {
  91.     { 0x0000, 0x57ff, MRA_ROM },
  92.     { 0x8000, 0x83ff, MRA_RAM },
  93.     { 0x8400, 0x97ff, starfire_shadow_r },
  94.     { 0x9800, 0x9fff, starfire_input_r },
  95.     { 0xa000, 0xbfff, starfire_colorram_r },
  96.     { 0xc000, 0xffff, starfire_videoram_r },
  97.     { -1 }  /* end of table */
  98. };
  99.  
  100. static struct MemoryWriteAddress starfire_writemem[] =
  101. {
  102.     { 0x8000, 0x83ff, MWA_RAM, &starfire_ram },
  103.     { 0x8400, 0x8fff, starfire_shadow_w },
  104.     { 0x9000, 0x9fff, starfire_output_w },
  105.     { 0xa000, 0xbfff, starfire_colorram_w },
  106.     { 0xc000, 0xffff, starfire_videoram_w },
  107.     { -1 }    /* end of table */
  108. };
  109.  
  110. static struct MemoryReadAddress fireone_readmem[] =
  111. {
  112.     { 0x0000, 0x6fff, MRA_ROM },
  113.     { 0x8000, 0x83ff, MRA_RAM },
  114.     { 0x8400, 0x97ff, starfire_shadow_r },
  115.     { 0x9800, 0x9fff, fireone_input_r },
  116.     { 0xa000, 0xbfff, starfire_colorram_r },
  117.     { 0xc000, 0xffff, starfire_videoram_r },
  118.     { -1 }  /* end of table */
  119. };
  120.  
  121. static struct MemoryWriteAddress fireone_writemem[] =
  122. {
  123.     { 0x8000, 0x83ff, MWA_RAM, &starfire_ram },
  124.     { 0x8400, 0x8fff, starfire_shadow_w },
  125.     { 0x9000, 0x9fff, fireone_output_w },
  126.     { 0xa000, 0xbfff, starfire_colorram_w },
  127.     { 0xc000, 0xffff, starfire_videoram_w },
  128.     { -1 }    /* end of table */
  129. };
  130.  
  131.  
  132. INPUT_PORTS_START( starfire )
  133.     PORT_START      /* DSW0 */
  134.     PORT_DIPNAME( 0x03, 0x00, "Time" )
  135.     PORT_DIPSETTING(    0x00, "90 Sec" )
  136.     PORT_DIPSETTING(    0x01, "80 Sec" )
  137.     PORT_DIPSETTING(    0x02, "70 Sec" )
  138.     PORT_DIPSETTING(    0x03, "60 Sec" )
  139.     PORT_DIPNAME( 0x04, 0x00, "Coin(s) to Start" )
  140.     PORT_DIPSETTING(    0x00, "1" )
  141.     PORT_DIPSETTING(    0x04, "2" )
  142.     PORT_DIPNAME( 0x08, 0x00, "Fuel per Coin" )
  143.     PORT_DIPSETTING(    0x00, "300" )
  144.     PORT_DIPSETTING(    0x08, "600" )
  145.     PORT_DIPNAME( 0x30, 0x00, "Bonus" )
  146.     PORT_DIPSETTING(    0x00, "300 points" )
  147.     PORT_DIPSETTING(    0x10, "500 points" )
  148.     PORT_DIPSETTING(    0x20, "700 points" )
  149.     PORT_DIPSETTING(    0x30, "None" )
  150.     PORT_DIPNAME( 0x40, 0x00, "Score Table Hold" )
  151.     PORT_DIPSETTING(    0x00, "fixed length" )
  152.     PORT_DIPSETTING(    0x40, "fixed length+fire" )
  153.     PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
  154.  
  155.     PORT_START      /* IN1 */
  156.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1)
  157.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1)
  158.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1)
  159.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
  160.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
  161.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
  162.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
  163.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
  164.  
  165.     PORT_START  /* IN2 */
  166.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X, 100, 10, 0, 255 )
  167.  
  168.     PORT_START  /* IN3 */
  169.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y | IPF_REVERSE, 100, 10, 0, 255 )
  170.  
  171.     PORT_START /* Throttle (IN4) */
  172.     PORT_BITX( 0xFF, 0x00, IP_ACTIVE_HIGH | IPF_TOGGLE, "Throttle", KEYCODE_Z, IP_JOY_NONE )
  173. INPUT_PORTS_END
  174.  
  175. INPUT_PORTS_START( fireone )
  176.     PORT_START      /* DSW0 */
  177.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
  178.     PORT_DIPSETTING(    0x03, "2 Coins/1 Player" )
  179.     PORT_DIPSETTING(    0x02, "2 Coins/1 or 2 Players" )
  180.     PORT_DIPSETTING(    0x00, "1 Coin/1 Player" )
  181.     PORT_DIPSETTING(    0x01, "1 Coin/1 or 2 Players" )
  182.     PORT_DIPNAME( 0x0c, 0x0c, "Time" )
  183.     PORT_DIPSETTING(    0x00, "75 Sec" )
  184.     PORT_DIPSETTING(    0x04, "90 Sec" )
  185.     PORT_DIPSETTING(    0x08, "105 Sec" )
  186.     PORT_DIPSETTING(    0x0c, "120 Sec" )
  187.     PORT_DIPNAME( 0x30, 0x00, "Bonus difficulty" )
  188.     PORT_DIPSETTING(    0x00, "Easy" )
  189.     PORT_DIPSETTING(    0x10, "Normal" )
  190.     PORT_DIPSETTING(    0x20, "Hard" )
  191.     PORT_DIPSETTING(    0x30, "Very hard" )
  192.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
  193.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  194.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  195.     PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
  196.  
  197.     PORT_START      /* IN1 */
  198.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1)
  199.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2)
  200.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1)
  201.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2)
  202.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN)
  203.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN)
  204.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN)
  205.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN)
  206.  
  207.     PORT_START  /* IN2 */
  208.     PORT_ANALOG( 0x3f, 0x20, IPT_AD_STICK_X, 100, 10, 0, 63 )
  209.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2)
  210.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1)
  211.  
  212.     PORT_START  /* IN3 */
  213.     PORT_ANALOG( 0x3f, 0x20, IPT_AD_STICK_Y, 100, 10, 0, 63 )
  214.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4)
  215.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3)
  216. INPUT_PORTS_END
  217.  
  218. static struct MachineDriver machine_driver_starfire =
  219. {
  220.     /* basic machine hardware */
  221.     {
  222.         {
  223.             CPU_Z80,
  224.             2500000,    /* 2.5 Mhz */
  225.             starfire_readmem, starfire_writemem,0,0,
  226.             starfire_interrupt,2
  227.         }
  228.     },
  229.     57, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  230.     1,    /* single CPU, no need for interleaving */
  231.     0,
  232.  
  233.     /* video hardware */
  234.     256,256,
  235.     { 0, 256-1, 0, 256-1 },
  236.     0,
  237.     64, 64, 0,
  238.  
  239.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  240.     0,
  241.     starfire_vh_start,
  242.     starfire_vh_stop,
  243.     starfire_vh_screenrefresh,
  244.  
  245.     /* sound hardware */
  246.     0,0,0,0
  247. };
  248.  
  249. static struct MachineDriver machine_driver_fireone =
  250. {
  251.     /* basic machine hardware */
  252.     {
  253.         {
  254.             CPU_Z80,
  255.             2500000,    /* 2.5 Mhz */
  256.             fireone_readmem, fireone_writemem,0,0,
  257.             starfire_interrupt,2
  258.         }
  259.     },
  260.     57, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  261.     1,    /* single CPU, no need for interleaving */
  262.     0,
  263.  
  264.     /* video hardware */
  265.     256,256,
  266.     { 0, 256-1, 0, 256-1 },
  267.     0,
  268.     64, 64, 0,
  269.  
  270.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  271.     0,
  272.     starfire_vh_start,
  273.     starfire_vh_stop,
  274.     starfire_vh_screenrefresh,
  275.  
  276.     /* sound hardware */
  277.     0,0,0,0
  278. };
  279.  
  280.  
  281. /***************************************************************************
  282.  
  283.   Game driver(s)
  284.  
  285. ***************************************************************************/
  286.  
  287. ROM_START( starfire )
  288.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  289.     ROM_LOAD( "sfire.1a",     0x0000, 0x0800, 0x9990af64 )
  290.     ROM_LOAD( "sfire.2a",     0x0800, 0x0800, 0x6e17ba33 )
  291.     ROM_LOAD( "sfire.1b",     0x1000, 0x0800, 0x946175d0 )
  292.     ROM_LOAD( "sfire.2b",     0x1800, 0x0800, 0x67be4275 )
  293.     ROM_LOAD( "sfire.1c",     0x2000, 0x0800, 0xc56b4e07 )
  294.     ROM_LOAD( "sfire.2c",     0x2800, 0x0800, 0xb4b9d3a7 )
  295.     ROM_LOAD( "sfire.1d",     0x3000, 0x0800, 0xfd52ffb5 )
  296.     ROM_LOAD( "sfire.2d",     0x3800, 0x0800, 0x51c69fe3 )
  297.     ROM_LOAD( "sfire.1e",     0x4000, 0x0800, 0x01994ec8 )
  298.     ROM_LOAD( "sfire.2e",     0x4800, 0x0800, 0xef3d1b71 )
  299.     ROM_LOAD( "sfire.1f",     0x5000, 0x0800, 0xaf31dc39 )
  300. ROM_END
  301.  
  302. ROM_START( fireone )
  303.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  304.     ROM_LOAD( "fo-ic13.7b",     0x0000, 0x0800, 0xf927f086 )
  305.     ROM_LOAD( "fo-ic24.7c",     0x0800, 0x0800, 0x0d2d8723 )
  306.     ROM_LOAD( "fo-ic12.6b",     0x1000, 0x0800, 0xac7783d9 )
  307.     ROM_LOAD( "fo-ic23.6c",     0x1800, 0x0800, 0x15c74ee7 )
  308.     ROM_LOAD( "fo-ic11.5b",     0x2000, 0x0800, 0x721930a1 )
  309.     ROM_LOAD( "fo-ic22.5c",     0x2800, 0x0800, 0xf0c965b4 )
  310.     ROM_LOAD( "fo-ic10.4b",     0x3000, 0x0800, 0x27a7b2c0 )
  311.     ROM_LOAD( "fo-ic21.4c",     0x3800, 0x0800, 0xb142c857 )
  312.     ROM_LOAD( "fo-ic09.3b",     0x4000, 0x0800, 0x1c076b1b )
  313.     ROM_LOAD( "fo-ic20.3c",     0x4800, 0x0800, 0xb4ac6e71 )
  314.     ROM_LOAD( "fo-ic08.2b",     0x5000, 0x0800, 0x5839e2ff )
  315.     ROM_LOAD( "fo-ic19.2c",     0x5800, 0x0800, 0x9fd85e11 )
  316.     ROM_LOAD( "fo-ic07.1b",     0x6000, 0x0800, 0xb90baae1 )
  317.     ROM_LOAD( "fo-ic18.1c",     0x6800, 0x0800, 0x771ee5ba )
  318. ROM_END
  319.  
  320.  
  321. GAMEX( 1979, starfire, 0, starfire, starfire, 0, ROT0, "Exidy", "Star Fire", GAME_NOT_WORKING | GAME_NO_SOUND )
  322. GAMEX( 1979, fireone,  0, fireone,  fireone,  0, ROT0, "Exidy", "Fire One", GAME_NOT_WORKING | GAME_NO_SOUND )
  323.